package com.lgw.coupon.mapper;

import com.lgw.commons.model.pojo.Coupon;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;

public interface CouponMapper {

    @Insert("insert into " +
            " coupon(template_id,customer_id,coupon_code," +
            " assign_time,status,is_valid, create_date, update_date) " +
            "values (#{templateId},#{customerId},#{couponCode},now(),#{status},1,now(),now()) " )
    @Options(useGeneratedKeys=true,keyProperty="id")
    int save(Coupon newCoupon);
}
